<template>
    <a-card :bordered="false">
        <module-search ref="search" @search="handleSearch" @add="handleAdd"></module-search>
        <module-table ref="table" @update="handleUpdate" />
        <module-form ref="form" @save="handleSave"></module-form>
    </a-card>
</template>

<script>
import ModuleSearch from './search';
import ModuleTable from './table';
import ModuleForm from './form';

export default {
    name: 'FormList',
    components: {
        ModuleTable,
        ModuleSearch,
        ModuleForm
    },
    data() {
        return {
            disableBtn: true
        };
    },
    methods: {
        handleSearch(query) {
            this.$refs.table.handleLoadData(query);
        },
        handleAdd() {
            this.$refs.form.show();
        },
        handleUpdate(row) {
            this.$refs.form.show(row);
        },
        handleSave() {
            this.$refs.table.handleLoadData();
        }
    }
};
</script>
